// Upgrade NOTE: commented out 'float4x4 _Object2World', a built-in variable
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'


Shader  "Vert/WaterfallTransparent" {

	Properties
	 {
 _MainTex ("Particle Texture", 2D) = "white" {}
 _Magnitude ("Distortion Magnitude", Float) = 1
 _Frequency ("Distortion Frequency", Float) = 1
 _InvWavelength ("Distortion InvWavelength", Float) = 10
}

	

	SubShader
     {
  Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
  ZWrite Off
  Cull Off
  Blend SrcAlpha OneMinusSrcAlpha
  ColorMask RGB

    LOD 100
	Pass
	{
	
	

	CGPROGRAM
	#pragma vertex vert
	#pragma fragment frag
	#include "UnityCG.cginc"
    //#define Fixed3(value)  fixed3(value, value,value)

	struct VertexInput {
    fixed4 vertex : POSITION;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    //fixed2 xlv_TEXCOORD1 : TEXCOORD1;
    //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
    //fixed4 tangent : TANGENT;
    fixed3 normal : NORMAL;
    fixed3 xlv_COLOR0 : COLOR;
	//VertexInput
	};


	struct VertexOutput {
	fixed4 pos : SV_POSITION;
    UNITY_FOG_COORDS(1)
    fixed3 xlv_COLOR0 : COLOR;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    //fixed2 xlv_TEXCOORD1 : TEXCOORD1;
    //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
	//VertexOutput
	};

	

 
 
 
 
 // float4x4 _Object2World;
 float4 _MainTex_ST;
 float _Magnitude;
 float _Frequency;
 float _InvWavelength;
 ;


	

 sampler2D _MainTex;




	VertexOutput vert (VertexInput v)
	{
	VertexOutput o;
	//o.pos = UnityObjectToClipPos (v.vertex);
	//o.xlv_TEXCOORD0 = TRANSFORM_TEX(v.xlv_TEXCOORD0, _MainTex);
	
  float4 tmpvar_1=float4(0,0,0,0);
  float4 tmpvar_2;
  tmpvar_2 = mul(unity_ObjectToWorld , v.vertex);
  float4 tmpvar_3;
  tmpvar_3.yzw = fixed3(0.0, 0.0, 0.0);
  tmpvar_3.x = (sin((
    ((_Frequency * _Time) * 25.0)
   + 
    (((tmpvar_2.x * _InvWavelength) + (tmpvar_2.y * _InvWavelength)) + (tmpvar_2.z * _InvWavelength))
  )) * _Magnitude).x;
  o.pos = UnityObjectToClipPos( (v.vertex + tmpvar_3));
  o.xlv_COLOR0 = tmpvar_1;
  o.xlv_TEXCOORD0 = ((v.xlv_TEXCOORD0 * _MainTex_ST.xy) + _MainTex_ST.zw);


    UNITY_TRANSFER_FOG(o,o.vertex);
   
	return o;
	}


	fixed4 frag(VertexOutput i) : SV_Target
    {
    //fixed4 tmpvar_2 = tex2D(_MainTex, i.uv);
	UNITY_APPLY_FOG(i.fogCoord, tmpvar_2);
	
  half4 tmpvar_1;
  fixed4 tmpvar_2;
  tmpvar_2 = tex2D (_MainTex, i.xlv_TEXCOORD0);
  tmpvar_1 = tmpvar_2;
  return tmpvar_1;

	}
	ENDCG
	}
  }
}

